package collect.collection.set.treeset;

import java.util.Iterator;
import java.util.TreeSet;

public class TestTreeSet {
    public static void main(String[] args) {
        Student stu1 = new Student("xuruiqi", 21, 100, 100, 100);
        Student stu2 = new Student("xuruiqi", 21, 10, 100, 100);
        Student stu3 = new Student("xuruiqi", 21, 10, 10, 100);
        Student stu4 = new Student("xuruiqi", 21, 1, 10, 100);
        Student stu5 = new Student("xuruiqi", 21, 10, 10, 10);
        TreeSet<Student> ts = new TreeSet<Student>();
        ts.add(stu1);
        ts.add(stu2);
        ts.add(stu3);
        ts.add(stu4);
        ts.add(stu5);
        Iterator<Student> iterator = ts.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
